cmake_minimum_required(VERSION 3.0.2)
project(robobaton_mini)

add_compile_options(-std=c++11)

find_package(catkin REQUIRED COMPONENTS
  roscpp
  rosmsg
  nav_msgs
  std_msgs
  serial
  cv_bridge
)

find_package(PkgConfig REQUIRED)
find_package(OpenCV REQUIRED)

#find_package(gflags REQUIRED)

catkin_package(
  CATKIN_DEPENDS
  INCLUDE_DIRS include
)
###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
  include
  ${catkin_INCLUDE_DIRS}
  ${SERIAL_INCLUDE_DIRS}
  ${OpenCV_INCLUDE_DIRS}
  /usr/include/eigen3
  src
)

set(SOURCE_FILES
    src/sdk/Base64.cpp
    src/sdk/CHttpRequest.cpp
    src/sdk/cJSON.cpp
    src/sdk/CommonSocket.cpp
    src/sdk/syslib.cpp
    src/sdk/vio_msg.cpp
    src/sdk/vio_sdk.cpp
    src/baton_cmd.cpp
    src/baton_mini.cpp
)
list(APPEND SOURCE_FILES src/baton_ros.cpp)

add_executable(mini_serial src/mini_serial.cpp)
target_link_libraries(mini_serial ${catkin_LIBRARIES})

add_executable(mini_odom_error src/mini_odom_error.cpp)
target_link_libraries(mini_odom_error ${catkin_LIBRARIES})

add_executable(mini_udp ${SOURCE_FILES})
target_link_libraries(mini_udp ${catkin_LIBRARIES} ${OpenCV_LIBS})